package com.code.base.busi.service;

import java.util.List;
import java.util.Date;
import java.util.Map;
import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.code.base.busi.persistence.BusiDepListMapper;
import com.code.base.busi.pojo.BusiDepList;
import com.code.util.PrimaryKeyUtil;


@Service
public class BusiDepListService {


	@Resource
	private BusiDepListMapper busiDepListMapper;

	public Long getInsertId() {
		return PrimaryKeyUtil.generatePrimaryKey();
	}

	public BusiDepList getDataById(Long id) {
		return busiDepListMapper.getDataById(id);
	}

	public List<BusiDepList> getAllData() {
		return busiDepListMapper.getAllData();
	}

	public int getDataCountByCondition(BusiDepList entity) {
		return busiDepListMapper.getDataCountByCondition(entity);
	}

	public List<BusiDepList> getDataByCondition(BusiDepList entity) {
		return busiDepListMapper.getDataByCondition(entity);
	}

	public int getDataCountByLikeCondition(BusiDepList entity) {
		return busiDepListMapper.getDataCountByLikeCondition(entity);
	}

	public List<BusiDepList> getDataByLikeCondition(BusiDepList entity) {
		return busiDepListMapper.getDataByLikeCondition(entity);
	}

	public List<BusiDepList> getDataByIds(Long[] ids) {
		return busiDepListMapper.getDataByIds(ids);
	}

	public void insertData(BusiDepList entity) {
		insertData(entity, true);
	}

	public void insertData(BusiDepList entity, boolean setIdValue) {
		if (setIdValue) {
			entity.setId(getInsertId());
		}
		busiDepListMapper.insertData(entity);
	}

	public void updateData(BusiDepList entity) {
		busiDepListMapper.updateData(entity);
	}

	public void updateDataByParam(Map<String, Object> map) {
		if (map.size() == 0)
			return;

		busiDepListMapper.updateDataByParam(map);
	}

	public void deleteDataByObject(BusiDepList entity) {
		busiDepListMapper.deleteDataByObject(entity);
	}

	public void deleteDataById(Long id) {
		busiDepListMapper.deleteDataById(id);
	}

	public void deleteDataByIds(Long[] ids) {
		busiDepListMapper.deleteDataByIds(ids);
	}

}
